<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<title></title>
	</head>

	<body>
		<script type="text/javascript">
			/**
			 * 一、while(条件)
			 *    {
			 * 		循环体
			 *    }
			 */
			var s = 0,i=1;
			while(i <= 100) {
				s=s+i;
				i++;
			}
			document.write("<h1>1...100的和为："+s+"</h1>")
		</script>
	</body>

</html>